home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Tools / Mac / MacMake.rul < prev    next >
Encoding:
Text File  |  1996-04-25  |  10.0 KB  |  307 lines  |  [TEXT/MPS ]

  1. #####################################################################################
  2. # Dummy target just in case some variables are empty
  3. #####################################################################################
  4.  
  5. SafeTarget = "{FWToolsDir}MacMake.rul"
  6.  
  7. #####################################################################################
  8. # CFM Static Library
  9. # A static library target is the same as the IDE target (SOM and resources)
  10. # plus the code target (.o)
  11. #
  12. # The static target is <module>.LIB (abstract)
  13. #
  14. # All object files in __ComponentObjects are libbed into <module>.o in the
  15. # objects folder. It you want it in the Lib folder see the .bmk for the
  16. # OS:Layer.
  17. #
  18. # All som and resource files are built as described below for the .IDE target.
  19. #####################################################################################
  20.  
  21. "{_FWTargetObjectsDir}{__ComponentName}.LIB" ƒ ∂
  22.             "{_FWTargetObjectsDir}{__ComponentName}.IDE" ∂
  23.             "{_FWLibDir}{__ComponentName}.o" ∂
  24.             {__OtherComponentDependencies}
  25.  
  26. "{_FWLibDir}{__ComponentName}.o" ƒ ∂
  27.         {__ComponentObjects} {SafeTarget}
  28.     {_FWEcho} {_FWEchoOptions} "Libbing:          {__ComponentName}.o"
  29.     {_FWLib} ∂
  30.         {__StaticLibraryLinkOptions} ∂
  31.         {__ComponentObjects} ∂
  32.         -o {TargDir}{__ComponentName}.o
  33.  
  34. #####################################################################################
  35. # Resources build Target
  36. #
  37. # This is an abstract target for building just resources.
  38. #
  39. # The IDE target is <module>.RSED (abstract)
  40. #
  41. # All resource files in __ComponentResources are built and consolidated into
  42. # <module>.IDE.rsrc in the objects directory.
  43. #####################################################################################
  44. # Abstract Target dependencies
  45. "{_FWTargetObjectsDir}{__ComponentName}.RSED" ƒ ∂
  46.             {__ComponentResources} {SafeTarget}
  47.  
  48. "{_FWTargetObjectsDir}{__ComponentName}.IDE.rsrc" ƒ ∂
  49.             {__ComponentResources} {SafeTarget}
  50.     #{_FWEcho} {_FWEchoOptions} "Consolidating: {__ComponentName}"
  51.     #Begin
  52.     #    for __resourceFile__ in {__FrameworkResources}
  53.     #        echo "include ∂"{__resourceFile__}∂" not ∂'ckid∂';"
  54.     #    end
  55.     #    for __resourceFile__ in {__ComponentResources}
  56.     #        echo "include ∂"{__resourceFile__}∂" not ∂'ckid∂';"
  57.     #    end
  58.     #End | {_FWRC} -t rsrc -c RSED -o "{_FWTargetObjectsDir}{__ComponentName}.IDE.rsrc"    
  59.  
  60. #####################################################################################
  61. # SOM build target
  62. # This an abstract target to get somc to update all the SOM-related files. It's meant
  63. # to be used by Rainbow.
  64. #
  65. # All som-dependent files in __ComponentSourcesFromIDL are updated by the SOM
  66. # compiler.
  67. #####################################################################################
  68.  
  69. "{_FWTargetObjectsDir}{__ComponentName}.SOM" ƒ ∂
  70.             {__ComponentSourcesFromIDL} {SafeTarget}
  71.  
  72. #####################################################################################
  73. # IDE build Target
  74. #
  75. # This is an abstract target for building resources and SOM-related files for 
  76. # the MetroWerks and Symantec IDEs (which will soon enough build their own rsrc files).
  77. #
  78. # The IDE target is <module>.IDE (abstract)
  79. #
  80. # All it does is invoke the .RSED and .SOM targets.
  81. #####################################################################################
  82. # Abstract Target dependencies
  83. "{_FWTargetObjectsDir}{__ComponentName}.IDE" ƒ ∂
  84.             "{_FWTargetObjectsDir}{__ComponentName}.SOM" ∂
  85.             "{_FWTargetObjectsDir}{__ComponentName}.RSED"
  86.  
  87. #####################################################################################
  88. # Inference Rules
  89. #####################################################################################
  90.  
  91. .a.o    ƒ    .a 
  92.     {_FWEcho} {_FWEchoOptions} "Assembling:       {default}.a"
  93.     {_FWAsm} ∂
  94.         {_FWAsmOptions} ∂
  95.         {__IncludeDirs} ∂
  96.         -o {_FWObjDir}{default}.a.o ∂
  97.         {depDir}{default}.a
  98.  
  99. .c.o    ƒ    .c 
  100.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.c"
  101.     {_FWC} ∂
  102.         {_FWCOptions} ∂
  103.         {__COptions} ∂
  104.         {__IncludeDirs} ∂
  105.         -o {TargDir}{default}.c.o ∂
  106.         {depDir}{default}.c
  107.  
  108. .cp.o    ƒ    .cp
  109.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.cp"
  110.     {_FWCpp} ∂
  111.         {_FWCppOptions} ∂
  112.         {__CppOptions} ∂
  113.         {__CIncludeDirs} ∂
  114.         {__IncludeDirs} ∂
  115.         -o {TargDir}{default}.cp.o ∂
  116.         {depDir}{default}.cp
  117.  
  118. .cpp.o    ƒ    .cpp
  119.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.cpp"
  120. #    We use a precompiled header file only if {__PrecompiledHeaderFile} is defined.
  121.     If {__PrecompiledHeaderFile}
  122.         {_FWCpp} ∂
  123.             {_FWCppOptions} ∂
  124.             {__CppOptions} ∂
  125.             {__IncludeDirs} ∂
  126.             {__CIncludeDirs} ∂
  127.             -load {__PrecompiledHeaderFile} ∂
  128.             -o {TargDir}{default}.cpp.o ∂
  129. #             -export_list {targDir}{default}.x ∂
  130.             {depDir}{default}.cpp
  131. #        dumpxcoff -n all {targDir}{default}.cpp.o | StreamEdit -s "{FWToolsDir}"exportScript > {targDir}{default}.z
  132.     Else
  133.         {_FWCpp} ∂
  134.             {_FWCppOptions} ∂
  135.             {__CppOptions} ∂
  136.             {__IncludeDirs} ∂
  137.             {__CIncludeDirs} ∂
  138.             -o {TargDir}{default}.cpp.o ∂
  139.             {depDir}{default}.cpp
  140.     End
  141.  
  142. # [HLX] for now we don't want to regenerate the .cpp file until Windows and Mac are stable
  143. #.cpp ƒ .idl
  144. #    {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.idl --> {default}.cpp"
  145. #    somc ∂
  146. #        {__IDLIncludeDirs} ∂
  147. #        -m cpluscpp -p -e xc ∂
  148. #        -D __PRIVATE__ ∂
  149. #        -I "{ODF}Found:FWCommon:Include:" ∂
  150. #        -I "{FWSOMIncludes}" ∂
  151. #        -I "{FWODIDLIncludes}" ∂
  152. #        -o {TargDir} ∂
  153. #        {depDir}{Default}.idl
  154. #    setfile -m . {Targ}
  155.  
  156. .xih ƒ .idl
  157.     {_FWEcho} {_FWEchoOptions} "Compiling:        {Default}.idl --> {Default}.xih"
  158.     somc ∂
  159.         {__IDLIncludeDirs} ∂
  160.         -m cpluscpp -p -e xih ∂
  161.         -D __PRIVATE__ ∂
  162.         -I "{ODF}Found:FWCommon:Include:" ∂
  163.         -I "{FWSOMIncludes}" ∂
  164.         -I "{FWODIDLIncludes}" ∂
  165.         -o {TargDir} ∂
  166.         -m chkexcept ∂
  167.         {DepDir}{Default}.idl
  168.  
  169. .xh ƒ .idl
  170.     {_FWEcho} {_FWEchoOptions} "Compiling:        {Default}.idl --> {Default}.xh"
  171.     somc ∂
  172.         {__IDLIncludeDirs} ∂
  173.         -m cpluscpp -e xh ∂
  174.         -D __PRIVATE__ ∂
  175.         -I "{ODF}Found:FWCommon:Include:" ∂
  176.         -I "{FWSOMIncludes}" ∂
  177.         -I "{FWODIDLIncludes}" ∂
  178.         -o {TargDir} ∂
  179.         -m chkexcept ∂
  180.         {DepDir}{Default}.idl
  181.  
  182. .rsrc    ƒ    .fr
  183.     {_FWEcho} {_FWEchoOptions} "ODFrc:            {default}.fr --> {Default}.rsrc"
  184.     {_FWODFRC} ∂
  185.         {_FWODFRCOptions} ∂
  186.         {__FWRCIncludeDirs} ∂
  187.         -o {TargDir}{default}.rsrc ∂
  188.         {DepDir}{default}.fr
  189.  
  190. .rsrc    ƒ    .r
  191.     {_FWEcho} {_FWEchoOptions} "Rezzing:          {default}.r --> {Default}.rsrc"
  192.     {_FWRC} ∂
  193.         {_FWRCOptions} ∂
  194.         {__FWRCIncludeDirs} ∂
  195.         {__IncludeDirs} ∂
  196.         -o {TargDir}{default}.rsrc ∂
  197.         {DepDir}{default}.r
  198.  
  199. #####################################################################################
  200. # Maintenance Targets
  201. #####################################################################################
  202.  
  203. "{_FWTargetObjectsDir}"CleanObj    ƒ
  204.     {_FWEcho} {_FWEchoOptions} "Deleting Object Files from:     {_FWTargetObjectsDir}"
  205.     delete -y -i {__ComponentObjects}
  206.  
  207. "{_FWTargetObjectsDir}"CleanRes    ƒ
  208.     {_FWEcho} {_FWEchoOptions} "Deleting Resources from :     {_FWTargetObjectsDir}"
  209.     delete -y -i {__ComponentResources}
  210.         
  211. "{_FWTargetObjectsDir}"CleanLib    ƒ
  212.     {_FWEcho} {_FWEchoOptions} "Deleting Libraries from :     {_FWLibDir}"
  213.     delete -y -i "{_FWLibDir}{__ComponentName}.o"
  214.     delete -y -i "{_FWLibDir}{__ComponentName}.rsrc"
  215.  
  216. "{_FWTargetObjectsDir}"CleanAll    ƒ ∂
  217.     "{_FWTargetObjectsDir}"CleanObjects ∂
  218.     "{_FWTargetObjectsDir}"CleanResources ∂
  219.     "{_FWTargetObjectsDir}"CleanLibs
  220.  
  221. "{_FWTargetObjectsDir}"KillDir    ƒ ∂
  222.     "{_FWTargetObjectsDir}"CleanLibs
  223.     {_FWEcho} {_FWEchoOptions} "Deleting Build Directory:     {_FWTargetObjectsDir}"
  224.     delete -y -i "{_FWTargetObjectsDir}"
  225.     
  226. #####################################################################################
  227. # CFM Shared Libraries
  228. #
  229. # A shared library target is the same as the IDE target (som/idl and resources)
  230. # plus it will use the MPW-hosted compiler specified by the build suite to compile
  231. # the object files. This case will mainly be CFM-68K
  232. #
  233. # The shared library target is <module>.CFM (abstract)
  234. #
  235. # All __ComponentObjects are linked into a shared library in the objects folder.
  236. #
  237. # All som/idl and resource files are built as described in MacMake.rul for the IDE
  238. # target.
  239. #####################################################################################
  240. # Abstract Target dependencies
  241. "{_FWTargetObjectsDir}{__ComponentName}.CFM" ƒ ∂
  242.             "{_FWTargetObjectsDir}{__ComponentName}.IDE" ∂
  243.             "{_FWBinDir}{__ComponentName}" ∂
  244.             {__OtherComponentDependencies}
  245.  
  246. "{_FWBinDir}{__ComponentName}" ƒ ∂
  247.             "{_FWObjDir}{__ComponentName}.pef"
  248.     duplicate -y "{_FWObjDir}{__ComponentName}.pef" {Targ}
  249.     If  `Exists "{_FWObjDir}{__ComponentName}.SYM"`
  250.         duplicate -y "{_FWObjDir}{__ComponentName}.SYM" {Targ}.SYM
  251.     End
  252.     
  253. "{_FWObjDir}{__ComponentName}Cache.rsrc" ƒ ∂
  254.             {__FrameworkResources} ∂
  255.             {__ComponentResources}
  256.     {_FWEcho} {_FWEchoOptions} "Consolidating: {__ComponentName}"
  257.     Begin
  258.         for __resourceFile__ in {__FrameworkResources}
  259.             echo  "include ∂"{__resourceFile__}∂";"
  260.         end
  261.         for __resourceFile__ in {__ComponentResources}
  262.             echo  "include ∂"{__resourceFile__}∂";"
  263.         end
  264.     End | {_FWRC} -a -o "{_FWObjDir}{__ComponentName}Cache.rsrc"
  265.  
  266. "{_FWObjDir}{__ComponentName}.seg" ƒ ∂
  267.             {__ComponentObjects} ∂
  268.             {__OpenDocObjects} ∂
  269.             {__ODFObjects} ∂
  270.             {__OtherObjects}
  271.         {_FWEcho} {_FWEchoOptions} "Linking:     {_FWObjDir}{__ComponentName}"
  272.         {_FWLink} ∂
  273.             {_FWLinkOptions} ∂
  274.             {__SharedLibraryLinkOptions} ∂
  275.             -weaklib QuickDrawGXLib,AppleScriptLib ∂
  276.             -init {__CFMInitFunction} ∂
  277.             {__Exports} ∂
  278.             {__InitLibs} ∂
  279.             {__ComponentObjects} ∂
  280.             {__ODFObjects} ∂
  281.             {__OpenDocObjects} ∂
  282.             {__OtherObjects} ∂
  283.             {__SystemObjects} ∂
  284.             -o {Targ}
  285. #    If !{Status}
  286. #        ILinkToSym -mf {Targ}.NJ -o "{_FWObjDir}{__ComponentName}".SYM 
  287. #    End
  288.  
  289. "{_FWObjDir}{__ComponentName}.pef" ƒ ∂
  290.             "{_FWObjDir}{__ComponentName}.seg" ∂
  291.             "{_FWObjDir}{__ComponentName}Cache.rsrc"
  292.     If "{_FWLink}" == 'ILink'
  293.         MakeFlat "{_FWObjDir}{__ComponentName}".seg -o {Targ}
  294.     Else
  295.         Duplicate -y "{_FWObjDir}{__ComponentName}".seg {Targ}
  296.     End
  297.     {_FWEcho} {_FWEchoOptions} Copying Resources From: "{_FWObjDir}{__ComponentName}Cache.rsrc"
  298.     Echo "include ∂"{_FWObjDir}{__ComponentName}Cache.rsrc∂";" | Rez -a -o {Targ}
  299.     If {__ComponentSignature}
  300.         SetFile -c {__ComponentSignature} -a B -t 'shlb' -m . {Targ}
  301.     Else
  302.         {_FWEcho} {_FWEchoOptions} "Warning: __ComponentSignature not set; using default (cfmg)."
  303.         SetFile -c 'cfmg' -t 'shlb' -m . {Targ}
  304.     End
  305.